<template>
  <div>
    <el-tabs type="border-card">
      <el-tab-pane label="用户配置">
        <div>
          <r-search
            ref="search"
            :searchData="searchData"
            :searchForm="searchForm"
            :searchHandle="searchHandle"
            :searchRules="searchRules"
            :inline="false"
            labelWidth="180px"
            labelPosition="right"
          />
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  export default {
    name: "equipment_configuration",
    data(){
      return{
        searchData: {
          userToVipMoney:'',
        },
        searchForm: [
          { type: "input",label:'成为会员充值金额', placeholder: "请输入", prop: "userToVipMoney", width: 200 },
        ],
        searchHandle: [
          {type:'primary',label:'保存', handle: e => this.elFormSubmit(),}
        ],
        searchRules:{
          outOfStockJz: [
            {required: true,message: '请输入',trigger: 'blur'},
          ]
        }
      }
    },
    mounted(){
      this.getData();
    },
    methods:{
      async getData(){
        var res=await this.apis.getUserConfig({});
        this.searchData=res.data||{};
      } ,
      elFormSubmit(){
        this.$refs.search.$refs.ruleForm.validate((valid) => {
          if (valid) {
            this.submit();
          }
        })
      },
      async submit(){
        var res=await this.apis.updateUserConfig({
          userToVipMoney:this.searchData.userToVipMoney
        });

        this.$message({
          message:'操作成功',
          type:'success'
        });
      }
    }
  }
</script>

<style scoped lang="scss">

</style>
